#!/usr/bin/php
<?php
	$argc > 1 or die ("Syntax: ${argv [0]} expression\n");

#$Matches = array ();
#$Test = "'foo''bar'''''";
#$Test = '"foo""bar"""""';
#$Pattern = '(^ ( ( \' ) ( .*? ) ( (?<! \' ) ( \' ) ( \' \' )* (?! \' ) ) | ( " ) ( .*? ) ( (?<! " ) ( " ) ( " " )* (?! " ) ) ) )x';

#preg_match ($Pattern, $Test, $Matches);
#var_dump ($Matches);
#die ();




	function __autoload ($CName) {
		if (! file_exists ($FName = "Classes/$CName.php")) return (FALSE);
		require_once ($FName);
	}

	foreach (glob ('Classes/Unaries/*.php') as $FName) require_once ($FName);
	foreach (glob ('Classes/Binaries/*.php') as $FName) require_once ($FName);

	$Expr = new Expression ('.');

	$Result = $Expr->Analyse ($argv [1]);

#	$Result = $Expr->Synthesize ($Result);

#	var_dump ($Result);
#	var_dump ($argv [1]);

?>